/**
 * @author antonio081014
 * @since Nov 29, 2011, 4:02:41 AM
 */
import java.util.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;
import java.awt.geom.*;

public class RainyRoad {
	public int N;

	public String isReachable(String[] road) {
		N = road[0].length();
		boolean[][] mark = new boolean[2][N];
		if (search(mark, 0, 0, road))
			return "YES";
		else
			return "NO";
	}

	public boolean search(boolean[][] mark, int x, int y, String[] road) {
		if (x == 0 && y == N - 1)
			return true;
		if (y >= N)
			return false;
		mark[x][y] = true;
		boolean ret = false;
		int xx = 1 - x;
		if (road[xx].charAt(y) != 'W' && !mark[xx][y])
			ret = ret || search(mark, xx, y, road);
		if (y + 1 < N && road[x].charAt(y + 1) != 'W' && !mark[x][y + 1])
			ret = ret || search(mark, x, y + 1, road);
		if (y + 1 < N && road[xx].charAt(y + 1) != 'W' && !mark[xx][y + 1])
			ret = ret || search(mark, xx, y + 1, road);
		return ret;
	}

	// <%:testing-code%>
}
// Powered by [KawigiEdit] 2.0!
